package com.cm.caseManagement.service.impl;

import com.cm.caseManagement.dao.CmSysAttachmentMapper;
import com.cm.caseManagement.pojo.entity.CmSysAttachment;
import com.cm.caseManagement.service.ICmSysAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 附件Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmSysAttachmentServiceImpl implements ICmSysAttachmentService
{
    @Autowired
    private CmSysAttachmentMapper cmSysAttachmentMapper;

    /**
     * 查询附件
     *
     * @param id 附件主键
     * @return 附件
     */
    @Override
    public CmSysAttachment selectCmSysAttachmentById(Long id)
    {
        return cmSysAttachmentMapper.selectCmSysAttachmentById(id);
    }

    /**
     * 查询附件列表
     *
     * @param cmSysAttachment 附件
     * @return 附件
     */
    @Override
    public List<CmSysAttachment> selectCmSysAttachmentList(CmSysAttachment cmSysAttachment)
    {
        return cmSysAttachmentMapper.selectCmSysAttachmentList(cmSysAttachment);
    }

    /**
     * 新增附件
     *
     * @param cmSysAttachment 附件
     * @return 结果
     */
    @Override
    public int insertCmSysAttachment(CmSysAttachment cmSysAttachment)
    {
        return cmSysAttachmentMapper.insertCmSysAttachment(cmSysAttachment);
    }

    /**
     * 修改附件
     *
     * @param cmSysAttachment 附件
     * @return 结果
     */
    @Override
    public int updateCmSysAttachment(CmSysAttachment cmSysAttachment)
    {
        return cmSysAttachmentMapper.updateCmSysAttachment(cmSysAttachment);
    }

    /**
     * 批量删除附件
     *
     * @param ids 需要删除的附件主键
     * @return 结果
     */
    @Override
    public int deleteCmSysAttachmentByIds(Long[] ids)
    {
        return cmSysAttachmentMapper.deleteCmSysAttachmentByIds(ids);
    }

    /**
     * 删除附件信息
     *
     * @param id 附件主键
     * @return 结果
     */
    @Override
    public int deleteCmSysAttachmentById(Long id)
    {
        return cmSysAttachmentMapper.deleteCmSysAttachmentById(id);
    }
}
